//
//  YFShopDetailCell.m
//  QuanJieShopProject
//
//  Created by apple on 2018/5/16.
//  Copyright © 2018年 apple. All rights reserved.
//

#import "YFShopDetailCell.h"


@implementation YFShopDetailCellModel

@end

@implementation YFShopDetailCell
+ (instancetype)cellWithTableView:(UITableView *)tableView {
    static NSString *cellID = @"YFShopDetailCellID";
    YFShopDetailCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
    if (!cell) {
        cell = [[YFShopDetailCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
    }
    return cell;
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self makeView];
    }
    return self;
}

- (void)makeView {
    
    UIView *containerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, UISCREEN_WIDTH, 44)];
    self.containerView = containerView;
//    containerView.backgroundColor = [UIColor blueColor];
    [self.contentView addSubview:containerView];
    
    UILabel *titleLabel = [[UILabel alloc] init];
    titleLabel.text = @"服务";
    titleLabel.font = [UIFont systemFontOfSize:14];
    titleLabel.textColor = [UIColor colorWithHexString:@"aaaaaa"];
    self.titleLabel = titleLabel;
    [self.containerView addSubview:titleLabel];
    
    UILabel *detailLabel = [[UILabel alloc] init];
    detailLabel.text = @"品质保证 7天无理由退换 极速发货 担保交易";
    detailLabel.font = [UIFont systemFontOfSize:14];
    detailLabel.textColor = YFColor_Text;
    self.detailLabel = detailLabel;
    [self.containerView addSubview:detailLabel];
    
    UIImageView *imgView = [[UIImageView alloc] init];
    imgView.image = [UIImage imageNamed:@"select"];
    [self.containerView addSubview:imgView];
    self.selectImgView = imgView;
    
    [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.equalTo(@44);
        make.left.equalTo(self.containerView).with.offset(10);
        make.top.bottom.equalTo(self.containerView);
    }];
    
    [detailLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self.selectImgView.mas_left);
        make.left.equalTo(self.titleLabel.mas_right);
        make.top.bottom.equalTo(self.containerView);
    }];
    
    [imgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self.containerView).with.offset(-10);
        make.width.height.equalTo(@15);
        make.centerY.equalTo(self.containerView);
    }];
    
//    UIButton *redButton = [[UIButton alloc] init];
//    redButton.frame = CGRectMake(0, 0, 50, 44);
//    [redButton setTitle:@"点击" forState:UIControlStateNormal];
//    [redButton addTarget:self action:@selector(redButtonClick) forControlEvents:UIControlEventTouchUpInside];
//    redButton.backgroundColor = [UIColor redColor];
//    [self.contentView addSubview:redButton];
}







- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
